
/*	You may freely copy, distribute and reuse the code in this example.
 *	Eric Tremblay disclaims any warranty of any kind, expressed or implied, as to
 *	its fitness for any particular use.
 *     May 31, 1992
 */

/* Generated by Interface Builder */

#import "WhatButton.h"
#import <appkit/Form.h> /* Used by the selectCellWithTag function */
#import <appkit/Matrix.h> /* Used by the setTag:at:: function */
#import <appkit/Button.h> /* Needed to button matrix */

@implementation WhatButton

-FindButton:sender
/* This method checks what is the number of the tag of the current selected radio button */
{
   int WhichOne;
   WhichOne = [ButtonBox selectedTag]; /* assigns the value of the currently selected button */
   /* using tag as a reference */
   
   [NSelectedButton setIntValue:WhichOne]; /* display the value of the tag in the form */
   
   return self;
 }
 
- selectButton0:sender
/* This simply selects the proper radio button using the tag */
{
    [ButtonBox selectCellWithTag:0]; /* This will select radio button number 0 */ 
    return self;
}

- selectButton1:sender
/* This simply selects the proper radio button using the tag */
{
    [ButtonBox selectCellWithTag:1]; /* This will select radio button number 1 */ 
    return self;
}

- selectButton2:sender
/* This simply selects the proper radio button using the tag */
{
    [ButtonBox selectCellWithTag:2]; /* This will select radio button number 2 */ 
    return self;
}

- selectButton3:sender
/* This simply selects the proper radio button using the tag */
{
    [ButtonBox selectCellWithTag:3]; /* This will select radio button number 3 */ 
    return self;
}

- selectButton4:sender
/* This simply selects the proper radio button using the tag */
{
    [ButtonBox selectCellWithTag:4]; /* This will select radio button number 4 */ 
    return self;
}

- AddARadioButton:sender
/* This method adds a new radio button to the ButtonBox matrixs */
{
    [ButtonBox insertRowAt:5]; /* Adds a new row to the radio button matrix */
    [ButtonBox sizeToCells];  /* resizes the matrix frame to contain all the cells */
    [ButtonBox display]; /* display the ButtonBox matrix */
    return self;
 }

- RemoveARadioButton:sender
/* This method will remove a radio button from the ButtonBox matrix */
{

   [ButtonBox removeRowAt:5 andFree:YES]; /* Remove a row from matrix and frees the cell */
   [ButtonBox display]; /* display the ButtonBox matrix */
   return self;
 }

- ButtonA:sender
/* This method simply displays which button was pressed in the ActionDisplay */
{
   [ActionDisplay setStringValue:"Button A Selected"];
   return self;
 }
 
 - ButtonB:sender
/* This method simply displays which button was pressed in the ActionDisplay */
{
   [ActionDisplay setStringValue:"Button B Selected"];
   return self;
 }

- ButtonC:sender
/* This method simply displays which button was pressed in the ActionDisplay */
{
   [ActionDisplay setStringValue:"Button C Selected"];
   return self;
 }


@end
